<head>
	<link rel="stylesheet" type="text/css" href="/members/profile_inner.css" />
	<script type="text/javascript" src="javascript/forum_home.js"></script>
</head>

<?php if (!$_SESSION['username']) { ?>
<table>
<tbody>
	<tr>
	
	<td>
		<div class="subhead">
			User Forum
		</div>
		<div class="simple">
			The forum is a place where members can meet and share their ideas about art and other topics.
		</div>
	</td>
	
	<td><img src="/img/separator.gif" /></td>
				
	<td width="100">
		<span class="subhead_purple">Log in:</span>
	</td>
		
	<td>
		<form name="login" method="post" action="/checkLogin.php">
		<?php if ($_GET['event'] == "badlogin") {
			?>
		<span class="redtext">Incorrect login information, please try again.</span>
		<?php } ?>
			<table><tr>
			<td>Username</td> <td><input name="username" class="loginform_p" type="text" size="25" /></td></tr>
			<tr><td>Password</td> <td><input name="password" class="loginform_p" type="password" size="25" /></td></tr>
			<tr><td></td><td><input class="loginform_p_button" type="submit" value="Login" /></td></tr></table>
			<div class="horizontal_separation"></div>
			<img src="/img/arrow_green.gif"><a href="/frame.php?page=signup.php">Don't have an account? Sign up!</a>
		</form>
	</td>
	
	</tr>
</tbody>
</table>
<?php } ?>


Hello
<table cellspacing="2">
	<tr align="center">
		<td width="340"></td>
		
		<td width="96">Last<img src="img/downarrow_orange.png" /></td>
		<td width="64">Threads<img src="img/downarrow_blue.png" /></td>
		<td width="64">Posts<img src="img/downarrow_green.png" /></td>
	</tr>

<?php

	error_reporting(0);
	session_start();
	error_reporting(1);

	$site_root = "../";
	require_once ($site_root . "common/PinSQL.obj");
	$pinSQL = new PinSQL();
	$pinSQL2 = new PinSQL();

	$pinSQL->Query("SELECT * FROM forum_ids");
	
	while ( $row = $pinSQL->FetchNextRow() )
	{
?>

	<tr height="80">
		<td colspan="4" class="forum_banner" id="banner<?php echo $row['forum_id'] ?>"  onmouseover="highlightForumBanner(<?php echo $row['forum_id'] ?>);" onmouseout="highlightForumBanner(<?php echo $row['forum_id'] ?>);" onclick="showThreads(<?php echo $row['forum_id']?>);">
		
			<table><tr><td width="60">
				<img src="img/forum_icon.png" />
			</td><td>
				<div class="forum_title"><?php echo $row['forum_name']; ?></div>
				<?php echo $row['forum_description']; ?>
				</div>
			</td>


		
			<td class="forum_banner" id="last<?php echo $row['forum_id'] ?>" align="center" onmouseover="highlightForumBanner(<?php echo $row['forum_id'] ?>);" onmouseout="highlightForumBanner(<?php echo $row['forum_id'] ?>);">last user</td>
			<td class="forum_banner" id="threads<?php echo $row['forum_id'] ?>" align="center" onmouseover="highlightForumBanner(<?php echo $row['forum_id'] ?>);" onmouseout="highlightForumBanner(<?php echo $row['forum_id'] ?>);"><?php
		
			$pinSQL2->Query("SELECT * FROM forum_thread_ids WHERE forum_id=" . $row['forum_id']);
			echo $pinSQL2->GetNumRows();
		
			?></td>
			<td class="forum_banner" id="posts<?php echo $row['forum_id'] ?>" align="center" onmouseover="highlightForumBanner(<?php echo $row['forum_id'] ?>);" onmouseout="highlightForumBanner(<?php echo $row['forum_id'] ?>);"><?php
		
			$pinSQL2->Query("SELECT * FROM forum_posts WHERE forum_id=" . $row['forum_id']);
			echo $pinSQL2->GetNumRows();
		
			?></td>
			</tr></table>
	</tr>
	<tr><td>
		<div class="horizontal_separation">&nbsp;</div>	
	</td></tr>
	
	<tr>
	
		<?php
	
		$pinSQL2->Query("SELECT * FROM forum_thread_ids WHERE forum_id=" . $row['forum_id']);
		while ($thread = $pinSQL2->FetchNextRow())
		{
			?>
			<table class="threadList">
				<tr><td><?php echo $thread['thread_name']; ?></td>
				</tr>
			</table>
			<?php
		}	
		?>
	</tr>
	
	<tr><td>
		<div class="horizontal_separation">&nbsp;</div>
	</td></tr>

<?php
	}

?>
	
</table>